<!DOCTYPE html>
<html>

<head>

    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>奖励管理</title>
    <link rel="shortcut icon" href="favicon.ico">
    <link href="/static/manager/css/bootstrap.min.css?v=3.3.5" rel="stylesheet">
    <link href="/static/manager/css/font-awesome.min.css?v=4.4.0" rel="stylesheet">
    <!-- Data Tables -->
    <link href="/static/manager/css/plugins/dataTables/dataTables.bootstrap.css" rel="stylesheet">

    <link href="/static/manager/css/animate.min.css" rel="stylesheet">
    <link href="/static/manager/css/style.min.css?v=4.0.0" rel="stylesheet"><base target="_blank">
</head>

<body class="gray-bg">
    <div class="wrapper wrapper-content animated fadeInRight">
        <div class="row">
            <div class="col-sm-12">
                <div class="ibox float-e-margins">
                    <div class="ibox-title">
                        <h5>奖励记录</h5>
                    </div>
                    <div class="row">
                        <div class="col-sm-8">
                            <div class="ibox float-e-margins">
                                <div class="ibox-title">
                                    <h5>发放奖励</h5>
                                </div>
                                <div class="ibox-content">
                                    <form role="form" class="form-inline">
                                        <div class="form-group">
                                            <input type="text" placeholder="请输入用户手机号"  class="form-control" name="detail_user">
                                        </div>
                                        <div class="form-group">
                                            <input type="text" placeholder="请输入奖励金额"  class="form-control" name="detail_value">
                                        </div>

                                        <a style="margin-top: 4px;" data-toggle="modal" class="btn btn-primary" href="javascript:void(0)" id="addred">
                                            添加奖励
                                        </a>
                                    </form>
                                </div>
                            </div>
                        </div>
                        <div class="col-sm-4">
                            <div class="ibox float-e-margins">
                                <div class="ibox-title">
                                    <h5>奖励池总额</h5>
                                </div>
                                <div class="ibox-content">
                                    <h1 class="no-margins" style="padding-bottom: 10px; color: #00B83F;">
                                        {$reward}<span style="font-size: 16px; color:#bebebe;">元</span>
                                    </h1>
                                </div>
                            </div>
                        </div>
                    </div>

                    <div class="ibox-content">

                        <table class="table table-striped table-bordered table-hover dataTables-example">
                            <thead>
                                <tr>
                                    <th>奖励编号</th>
                                    <th>手机号</th>							
                                    <th>奖励金额</th>
                                    <th>奖励时间</th>
                                </tr>
                            </thead>
                            <tbody>
                            {volist name='txdata' id='vo'}
                                <tr class="gradeX">
                                    <td>REWARDM{$vo.detail_id}</td>
                                    <td>{$vo.detail_user}</td>
                                    <td>￥{$vo.detail_value}</td>
                                    <th>{$vo.detail_time}</th>
                                </tr>
                            {/volist}
                            </tbody>
                        </table>

                    </div>
                </div>
            </div>
        </div>
        
    </div>
    <script src="/static/manager/js/jquery.min.js?v=2.1.4"></script>
    <script src="/static/manager/js/bootstrap.min.js?v=3.3.5"></script>
    <script src="/static/manager/js/plugins/jeditable/jquery.jeditable.js"></script>
    <script src="/static/manager/js/plugins/dataTables/jquery.dataTables.js"></script>
    <script src="/static/manager/js/plugins/dataTables/dataTables.bootstrap.js"></script>
    <script src="/static/manager/js/content.min.js?v=1.0.0"></script>
    <script>
        $(document).ready(function() {
            $(".dataTables-example").dataTable();

            $("#addred").click(function () {
                var detail_user=$("input[name='detail_user']").val();
                var detail_value=$("input[name='detail_value']").val();
                $.post("/manager/Index/reward_add", {detail_user:detail_user,detail_value:detail_value}, function (result) {
                    if(result==200){
                        alert("奖励成功！");
                        window.location.reload();
                    }else {
                        alert(result);
                    }

                });
            });
        });
    </script>


</body>

</html>